import { createStore, applyMiddleware, compose } from 'redux'
import thunk from 'redux-thunk'
import reducer from './reducer'

//redux-devtools
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({trace: true}) || compose;

//使用 redux-thunk 中间件
const store = createStore(reducer, composeEnhancers(applyMiddleware(thunk)));

export default store
